package com.main;

import com.main.thread.ThreadTest;

/**
 * @author Zhang Guangyong
 * @desacription 测试线程主类
 * @date 2019年07月10日 10:02
 */
public class MainThread {

    public static void main(String[] args) {

        // 继承方式实现线程
        // 声明线程实例
        ThreadTest thread1 = new ThreadTest();
        ThreadTest thread2 = new ThreadTest();
        ThreadTest thread3 = new ThreadTest();
        ThreadTest thread4 = new ThreadTest();
        ThreadTest thread5 = new ThreadTest();
        ThreadTest thread6 = new ThreadTest();

        // 开启线程
        thread1.start();
//        thread2.start();
//        thread3.start();
//        thread4.start();
//        thread5.start();
//        thread6.start();



        // 实现方式实现线程
//        RunnableTest runnableTest = new RunnableTest();
//        Thread thread1 = new Thread(runnableTest);
//        thread1.start();

//        try {
//            System.out.println("线程休眠开始");
//            int i = Thread.activeCount();
//            System.out.println(i);
//            Thread.sleep(4000);
//
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }

//        System.out.println("执行完毕");


    }
}
